home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / SourceCode / Tutorial / Cookbook / 02.alert / notes < prev    next >
Text File  |  1995-06-12  |  1KB  |  35 lines

  1.  
  2. Objective:
  3. Learn how to bring up an "Alert Panel"
  4. Learn what a "modal" window is and how it is used.
  5. Learn how to make calls to NeXT supplied "C" library roulines.
  6.  
  7. Summary:
  8.  
  9. Complexity:
  10.    number of message statements: 0
  11.    lines of C code: 3
  12.    lines of postscript: 0
  13.    
  14. Terms: model
  15.    
  16. Discussion:
  17. A model window is one that will not allow the user to do anything else in the application until
  18. a response is given.
  19.    
  20. Method:
  21. Create subclass of Object called "MyObject" and instanciate it.  Add one action method called
  22. "alert:" Add one button the the main window and then make a connection from the button to
  23. the instance of your object.  Do an "unparse from the Class editor and then add the following to
  24. the action method for "alert" in the MyObject file.
  25.  
  26. int answer;
  27.     answer = NXRunAlertPanel("Title", "Message", "Default", "Option One", "Option Two");
  28.     printf("Answer = %d\n", answer);
  29.  
  30.  
  31. Further Questions:
  32. What happens when you try to use the main "info", "hide" or "quit" menus whild the Alert panel
  33. is up?
  34.  
  35.